<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@ page import="com.iMusic.businessLogicLayer.Account" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>iMusic</title>

<link rel="stylesheet" type="text/css" href="iMusicMenu/sdmenu.css">
<script type="text/javascript" src="iMusicMenu/sdmenu.js"></script>
<script type="text/javascript">
	// <![CDATA[
	var myMenu;
	window.onload = function() {
		myMenu = new SDMenu("my_menu");
		myMenu.init();
	};
	// ]]>
	</script>
<script>
    function trim(s) 
    {
        return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
    }

    function validate()
    {
        if(trim(document.frmLogin.username.value)=="")
        {
          alert("Login empty");
          document.frmLogin.sUserName.focus();
          return false;
        }
        else if(trim(document.frmLogin.password.value)=="")
        {
          alert("password empty");
          document.frmLogin.sPwd.focus();
          return false;
        }
    }
</script>
</head>
<body>
<%
String error=request.getParameter("error");
if(error==null || error=="null"){
 error="";
}

%>
		<table
			style="text-align: left; width: 100%; background-color: rgb(204, 204, 204);"
			border="0" cellpadding="2" cellspacing="2">
			<tbody>
				<tr>
					<td style="vertical-align: middle; width: 424px;"><big
						style="font-weight: bold;"><big><big>iMusic</big></big></big><br>
						<big style="font-weight: bold;"><big>Online Music
								Store</big></big></td>
					<td
						style="vertical-align: middle; text-align: right; width: 365px;">
						<%
							String username = null;
							Account account = (Account) request.getSession().getAttribute("Account");
							if (account != null) {
								username = account.getUsername();
							}
							if (username==null || username=="null" || !error.equals("")) {
						%>
							<form style="vertical-align: middle; text-align: right; " onSubmit="return validate();" action="Login" method="post" name="Login">
							Username: <input name="username"><br>
							Password:&nbsp;	<input name="password" type="password"><br>
							<input value="Login" type="submit"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
							</form>
						
							New to iMusic? <a href="signup.html">Sign-up!</a>&nbsp;
						<% 
							}
							else {
								out.print("User "+username+ " is logged in.");
						%>
						
								<form style="vertical-align: middle; text-align: right; " action="Logout" method="post" name="Logout">
								<input value="Logout" type="submit"> </form>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
						<%		
							}
						%>
					</td>
				</tr>
			</tbody>
		</table>	

		<div style="float: left;" id="my_menu" class="sdmenu">
			<div>
				<span>Browse by Style</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>Vinyl</span> <a href="http://tools.dynamicdrive.com/button/">Alternative</a>
				<a href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>Collection of Vinyls</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>CD - Album</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>CD - Selection of MP3 songs</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>Collections of CDs</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>MP3 download - single song</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>MP3 download - album</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>MP3 download - collections</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>DVD - Live Performances</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>
			<div>
				<span>DVD - Collections</span> <a
					href="http://tools.dynamicdrive.com/button/">Alternative</a> <a
					href="http://tools.dynamicdrive.com/gradient/">Country</a> <a
					href="http://tools.dynamicdrive.com/button/">Dance</a> <a
					href="http://tools.dynamicdrive.com/password/">Disco</a> <a
					href="http://tools.dynamicdrive.com/button/">Eletronic</a> <a
					href="http://tools.dynamicdrive.com/favicon/">Jazz</a> <a
					href="http://www.dynamicdrive.com/emailriddler/">Pop</a> <a
					href="http://tools.dynamicdrive.com/imageoptimizer/">Rock</a>
			</div>


		</div>

		<div style="text-align: right; color: rgb(255, 0, 0);"><%=error%></div>
		<div style="margin-left: 240px;">
			<input size="50" name="query">&nbsp; <input name="searchImg"
				alt="" title="Search!" src="images/Search-icon.png" value=""
				type="image" height="20" width="20"><br>
		</div>
		

</body>
</html>